<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex acquisitionSales_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub acquisitionSales_fd0_0'>
          <view class='flex flex-wrap align-center acquisitionSales_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  acquisitionSales_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <!-- <text class='acquisitionSales_fd0_0_c1_c0'>{{type==1 ? '我的收购' : '我的经营'}}</text> -->
            <text class='acquisitionSales_fd0_0_c1_c0'>收购销售</text>
          </view>
          <view class='flex flex-wrap align-center justify-end acquisitionSales_fd0_0_c0'>
            <image class='acquisitionSales_fd0_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"7.png"'></image>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <view class='flex flex-wrap align-center justify-between acquisitionSales_fd1_0' @click.stop="isShow=true">
          <view class='flex flex-wrap align-center justify-center acquisitionSales_fd1_0_c0'>
            <benben-input class='acquisitionSales_fd1_0_c0_c0' type="text" :placeholder="`请输入开始时间`" confirm-type="done"
              :maxlength="-1" :disabled='true' placeholder-style="color:rgba(102, 102, 102, 1);font-size:30rpx"
              v-model="start_data" />
            <image class='acquisitionSales_fd1_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"126.png"'></image>
          </view>
          <text class='acquisitionSales_fd1_0_c1'>-</text>
          <view class='flex flex-wrap align-center justify-center acquisitionSales_fd1_0_c0'>
            <benben-input class='acquisitionSales_fd1_0_c0_c0' type="text" :placeholder="`请输入结束时间`" confirm-type="done"
              v-model="end_data" :maxlength="-1" :disabled='true'
              placeholder-style="color:rgba(102, 102, 102, 1);font-size:30rpx" />
            <image class='acquisitionSales_fd1_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"126.png"'></image>
          </view>
        </view>
        <view class='flex flex-wrap align-center justify-center acquisitionSales_fd1_1' @click="searchData">
          <button class='acquisitionSales_fd1_1_c0'>查询</button>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch acquisitionSales_fd1_2' v-if="type==1">
          <view class='flex flex-direction flex-wrap align-stretch acquisitionSales_fd1_2_c0'>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0'
              style="margin: 32rpx 0rpx 0rpx 0rpx;">
              <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0_c0'>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c0'>小麦</text>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c1'>(斤)</text>
              </view>
              <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0_c1'>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c0'>玉米</text>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c1'>(斤)</text>
              </view>
            </view>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c1'>
              <text class='acquisitionSales_fd1_2_c0_c1_c0'>收购</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c1'>{{xiaomai.shougoujunjia}}</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c2'>{{yumi.shougoujunjia}}</text>
            </view>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c2'>
              <text class='acquisitionSales_fd1_2_c0_c1_c0'>销售</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c1'>{{xiaomai.xiaoshoujunjia}}</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c2'>{{yumi.xiaoshoujunjia}}</text>
            </view>
          </view>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch acquisitionSales_fd1_2' v-if="type==2">
          <view class='flex flex-direction flex-wrap align-stretch acquisitionSales_fd1_2_c0'>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0'>
              <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0_c0'>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c0'>小麦</text>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c1'>(元)</text>
              </view>
              <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0_c1'>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c0'>玉米</text>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c1'>(元)</text>
              </view>
            </view>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c1'>
              <text class='acquisitionSales_fd1_2_c0_c1_c0'>收购金额</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c1'>{{xiaomai.shougoujunjia}}</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c2'>{{yumi.shougoujunjia}}</text>
            </view>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c2'>
              <text class='acquisitionSales_fd1_2_c0_c1_c0'>出售金额</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c1'>{{xiaomai.zongchushoujine}}</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c2'>{{yumi.zongchushoujine}}</text>
            </view>
          </view>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch acquisitionSales_fd1_2' v-if="type==2">
          <view class='flex flex-direction flex-wrap align-stretch acquisitionSales_fd1_2_c0'>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0'>
              <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0_c0'>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c0'>小麦</text>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c1'>(斤)</text>
              </view>
              <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0_c1'>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c0'>玉米</text>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c1'>(斤)</text>
              </view>
            </view>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c1'>
              <text class='acquisitionSales_fd1_2_c0_c1_c0'>收购数量</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c1'>{{xiaomai.zongshougoushuliang}}</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c2'>{{yumi.zongshougoushuliang}}</text>
            </view>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c2'>
              <text class='acquisitionSales_fd1_2_c0_c1_c0'>出售数量</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c1'>{{xiaomai.zongchushoushuliang}}</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c2'>{{yumi.zongchushoushuliang}}</text>
            </view>
          </view>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch acquisitionSales_fd1_2' v-if="type==2">
          <view class='flex flex-direction flex-wrap align-stretch acquisitionSales_fd1_2_c0'>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0'>
              <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0_c0'>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c0'>小麦</text>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c1'>(元)</text>
              </view>
              <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c0_c1'>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c0'>玉米</text>
                <text class='acquisitionSales_fd1_2_c0_c0_c0_c1'>(元)</text>
              </view>
            </view>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c1'>
              <text class='acquisitionSales_fd1_2_c0_c1_c0'>收购均价</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c1'>{{xiaomai.shougoujunjia}}</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c2'>{{yumi.shougoujunjia}}</text>
            </view>
            <view class='flex flex-wrap align-center acquisitionSales_fd1_2_c0_c2'>
              <text class='acquisitionSales_fd1_2_c0_c1_c0'>出售均价</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c1'>{{xiaomai.chushoujunjia}}</text>
              <text class='acquisitionSales_fd1_2_c0_c1_c2'>{{yumi.chushoujunjia}}</text>
            </view>
          </view>
        </view>
        <view class='flex flex-wrap align-center acquisitionSales_fd1_3'>
          <text class='acquisitionSales_fd1_3_c0'>注:此数据为截止到今日您已填写的数据统计!</text>
        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
    <!-- 日历弹框 start -->
    <fu-popup v-model="isShow" mode="center" :mask-close-able="true" @close="closePopup">
      <view class="calendar-box">
        <fu-calendar @change="change" active-bg-color="#f9e4c3" range-bg-color="#16583d1a" :future="true" start-text=""
          end-text="" mode="range" :isDefaultDay="false" :start-time="start_data" :end-time="end_data"></fu-calendar>
      </view>
    </fu-popup>
    <!-- 日历弹框 end -->
  </view>
</template>
<script>
  export default {
    components: {},


    data() {
      return {
        isShow: false,
        "start_data": "",
        "end_data": "",
        "state": "0",
        type: '',
        xiaomai: '',
        yumi: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      this.type = options.type
      this.getData()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      change(value) {
        if (value.isInit) return;
        this.end_data = value.end
        this.start_data = value.start
        this.isShow = false;
        console.log(value)
      },
      closePopup() {
        this.isShow = false;
        this.getData()
      },
      searchData() {
        this.getData()
      },
      getData() {
        let urls = ''
        if (this.type == 1) {
          urls = global.apiUrls.post65d6f581d3984
        } else {
          urls = global.apiUrls.post65d6e42c5c930
        }
        this.$api.post(urls, {
          start_time: this.start_data,
          end_time: this.end_data
        }).then(res => {
          if (res.data.code == 1) {
            this.xiaomai = res.data.data.xiaomai
            this.yumi = res.data.data.yumi
          }
        })
      },
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: linear-gradient(top, 90deg, #FFFFFF 0%, #F8F8FA 100%);
    background-size: 100% auto;
  }

  .acquisitionSales_flex_0 {
    background: rgba(255, 255, 255, 1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto;
  }

  .acquisitionSales_fd0_0_c2_c0 {
    width: 119rpx;
    height: 55rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .acquisitionSales_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .acquisitionSales_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .acquisitionSales_fd0_0_c0 {
    width: 120rpx;
  }

  .acquisitionSales_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .acquisitionSales_fd1_3_c0 {
    color: #BFBFBF;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .acquisitionSales_fd1_3 {
    margin: 30rpx 30rpx 0rpx 30rpx;
  }

  .acquisitionSales_fd1_2_c0_c2 {
    padding: 32rpx 0rpx 32rpx 0rpx;
    margin: 0rpx 40rpx 0rpx 40rpx;
  }

  .acquisitionSales_fd1_2_c0_c1_c2 {
    margin: 0rpx 0rpx 0rpx 165rpx;
    color: #FF5050;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .acquisitionSales_fd1_2_c0_c1_c1 {
    margin: 0rpx 0rpx 0rpx 106rpx;
    color: #FF5050;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .acquisitionSales_fd1_2_c0_c1_c0 {
    color: #101010;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .acquisitionSales_fd1_2_c0_c1 {
    border-bottom: 1px solid #eee;
    padding: 32rpx 0rpx 32rpx 0rpx;
    margin: 0rpx 40rpx 0rpx 40rpx;
  }

  .acquisitionSales_fd1_2_c0_c0_c1 {
    margin: 0rpx 0rpx 0rpx 76rpx;
  }

  .acquisitionSales_fd1_2_c0_c0_c0_c1 {
    margin: 0rpx 0rpx 0rpx 16rpx;
    color: #666666;
    font-size: 26rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .acquisitionSales_fd1_2_c0_c0_c0_c0 {
    color: #101010;
    font-size: 34rpx;
    font-weight: 700;
    line-height: 34rpx;
  }

  .acquisitionSales_fd1_2_c0_c0_c0 {
    margin: 0rpx 0rpx 0rpx 168rpx;
  }

  .acquisitionSales_fd1_2_c0_c0 {
    margin: 32rpx 0rpx 0rpx 48rpx;
  }

  .acquisitionSales_fd1_2_c0 {
    background: rgba(248, 248, 250, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
  }

  .acquisitionSales_fd1_2 {
    background: rgba(255, 255, 255, 1);
    margin: 42rpx 30rpx 0rpx 30rpx;
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 24rpx;
  }

  .acquisitionSales_fd1_1_c0 {
    background: rgba(37, 104, 174, 1);
    border-radius: 100rpx;
    width: 686rpx;
    line-height: 88rpx;
    font-size: 34rpx;
    color: #fff;
  }

  .acquisitionSales_fd1_1 {
    margin: 120rpx 0rpx 0rpx 0rpx;
  }

  .acquisitionSales_fd1_0_c1 {
    color: var(--benbenFontColor0);
    font-size: 45rpx;
  }

  .acquisitionSales_fd1_0_c0_c1 {
    width: 32rpx;
    height: 34rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 0rpx 0rpx 20rpx;
  }

  .acquisitionSales_fd1_0_c0_c0 {
    width: 210rpx;
    text-align: center;
    font-size: 30rpx;
    color: rgba(16, 16, 16, 1);
  }

  .acquisitionSales_fd1_0_c0 {
    background: rgba(248, 248, 250, 1);
    width: 310rpx;
    background-size: 100% auto;
    height: 88rpx;
    border-radius: 63rpx;
  }

  .acquisitionSales_fd1_0 {
    margin: 40rpx 40rpx 0rpx 40rpx;
  }

  // 日历弹框 start
  .calendar-box {
    background: #FFF;
    border-radius: 16rpx;
    width: 640rpx;
    padding: 0 24rpx;
    border: 1px solid transparent;
  }
</style>
